package com.nami.message.app.pmsg;

import com.nami.message.app.convertor.PrivateCmd2DomainConvertor;

import com.nami.message.domain.service.PrivateMessageDomainService;
import com.nami.message.facade.pmsg.PrivateMsgAddFacade;
import com.nami.message.facade.pmsg.request.PrivateMsgAddCmd;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


@Slf4j
@Service
@RequiredArgsConstructor
public class PrivateMsgAddFacadeImpl implements PrivateMsgAddFacade {

    private final PrivateMessageDomainService messageDomainService;

    @Override
    public void execute(PrivateMsgAddCmd cmd) {
        // 此处应与群方法统一，暂时为此。@date 2025-02-21
        // 方法名应与业务语义挂钩，不应为saveMsg, addMsg
        // recordMsgFromEvent
        // handleIncomingMessageEvent
        // process/record/register
        messageDomainService.processReceivedMessage(PrivateCmd2DomainConvertor.toDomain(cmd));
    }

}
